﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Linq.Expressions;
using System.Data.Common;

namespace SmartLib.Dal.Sql
{
    public static class DbCommandExtensions
    {
        /// <summary>
        /// 插入
        /// </summary>
        /// <param name="instance">实体对象</param>
        /// <param name="dbFactoryName">DB工厂名称</param>
        /// <returns>影响行数</returns>
        public static int Insert(object instance, string dbFactoryName)
        {
            return 0;
        }

        /// <summary>
        /// 插入
        /// </summary>
        /// <param name="instance">实体对象</param>
        /// <param name="predicate">where 条件表达式</param>
        /// <param name="dbFactoryName">DB工厂名称</param>
        /// <returns>影响行数</returns>
        public static int Update(object instance, Expression<Func<string, bool>> predicate, string dbFactoryName)
        {
            return 0;
        }

        /// <summary>
        /// 插入
        /// </summary>
        /// <param name="instance">实体对象</param>
        /// <param name="cmd">DbCommand</param>
        /// <returns>影响行数</returns>
        public static int Insert(object instance, DbCommand cmd)
        {
            return 0;
        }

        /// <summary>
        /// 更新
        /// </summary>
        /// <param name="instance">实体对象</param>
        /// <param name="cmd">DbCommand</param>
        /// <param name="predicate">Where条件表达式</param>
        /// <returns>影响行数</returns>
        public static int Update(object instance, DbCommand cmd, Expression<Func<string, bool>> predicate)
        {
            return 0;
        }
    }
}
